Left Termination of the query pattern perm_in_2(g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

append(nil, XS, XS).
append(cons(X, XS1), XS2, cons(X, YS)) :- append(XS1, XS2, YS).
split(XS, nil, XS).
split(cons(X, XS), cons(X, YS1), YS2) :- split(XS, YS1, YS2).
perm(nil, nil).
perm(XS, cons(Y, YS)) :- ','(split(XS, YS1, cons(Y, YS2)), ','(append(YS1, YS2, ZS), perm(ZS, YS))).

Queries:

perm(g,a).

We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in(XS, cons(Y, YS)) → U3(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
split_in(cons(X, XS), cons(X, YS1), YS2) → U2(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
split_in(XS, nil, XS) → split_out(XS, nil, XS)
U2(X, XS, YS1, YS2, split_out(XS, YS1, YS2)) → split_out(cons(X, XS), cons(X, YS1), YS2)
U3(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U4(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
append_in(cons(X, XS1), XS2, cons(X, YS)) → U1(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
append_in(nil, XS, XS) → append_out(nil, XS, XS)
U1(X, XS1, XS2, YS, append_out(XS1, XS2, YS)) → append_out(cons(X, XS1), XS2, cons(X, YS))
U4(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U5(XS, Y, YS, perm_in(ZS, YS))
perm_in(nil, nil) → perm_out(nil, nil)
U5(XS, Y, YS, perm_out(ZS, YS)) → perm_out(XS, cons(Y, YS))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
cons(x1, x2)  =  cons(x2)
U3(x1, x2, x3, x4)  =  U3(x4)
split_in(x1, x2, x3)  =  split_in(x1)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
nil  =  nil
split_out(x1, x2, x3)  =  split_out(x2, x3)
U4(x1, x2, x3, x4, x5, x6)  =  U4(x6)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4)  =  U5(x4)
perm_out(x1, x2)  =  perm_out(x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in(XS, cons(Y, YS)) → U3(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
split_in(cons(X, XS), cons(X, YS1), YS2) → U2(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
split_in(XS, nil, XS) → split_out(XS, nil, XS)
U2(X, XS, YS1, YS2, split_out(XS, YS1, YS2)) → split_out(cons(X, XS), cons(X, YS1), YS2)
U3(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U4(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
append_in(cons(X, XS1), XS2, cons(X, YS)) → U1(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
append_in(nil, XS, XS) → append_out(nil, XS, XS)
U1(X, XS1, XS2, YS, append_out(XS1, XS2, YS)) → append_out(cons(X, XS1), XS2, cons(X, YS))
U4(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U5(XS, Y, YS, perm_in(ZS, YS))
perm_in(nil, nil) → perm_out(nil, nil)
U5(XS, Y, YS, perm_out(ZS, YS)) → perm_out(XS, cons(Y, YS))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
cons(x1, x2)  =  cons(x2)
U3(x1, x2, x3, x4)  =  U3(x4)
split_in(x1, x2, x3)  =  split_in(x1)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
nil  =  nil
split_out(x1, x2, x3)  =  split_out(x2, x3)
U4(x1, x2, x3, x4, x5, x6)  =  U4(x6)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4)  =  U5(x4)
perm_out(x1, x2)  =  perm_out(x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(XS, cons(Y, YS)) → U31(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
PERM_IN(XS, cons(Y, YS)) → SPLIT_IN(XS, YS1, cons(Y, YS2))
SPLIT_IN(cons(X, XS), cons(X, YS1), YS2) → U21(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
SPLIT_IN(cons(X, XS), cons(X, YS1), YS2) → SPLIT_IN(XS, YS1, YS2)
U31(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U41(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
U31(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → APPEND_IN(YS1, YS2, ZS)
APPEND_IN(cons(X, XS1), XS2, cons(X, YS)) → U11(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
APPEND_IN(cons(X, XS1), XS2, cons(X, YS)) → APPEND_IN(XS1, XS2, YS)
U41(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U51(XS, Y, YS, perm_in(ZS, YS))
U41(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → PERM_IN(ZS, YS)

The TRS R consists of the following rules:

perm_in(XS, cons(Y, YS)) → U3(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
split_in(cons(X, XS), cons(X, YS1), YS2) → U2(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
split_in(XS, nil, XS) → split_out(XS, nil, XS)
U2(X, XS, YS1, YS2, split_out(XS, YS1, YS2)) → split_out(cons(X, XS), cons(X, YS1), YS2)
U3(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U4(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
append_in(cons(X, XS1), XS2, cons(X, YS)) → U1(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
append_in(nil, XS, XS) → append_out(nil, XS, XS)
U1(X, XS1, XS2, YS, append_out(XS1, XS2, YS)) → append_out(cons(X, XS1), XS2, cons(X, YS))
U4(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U5(XS, Y, YS, perm_in(ZS, YS))
perm_in(nil, nil) → perm_out(nil, nil)
U5(XS, Y, YS, perm_out(ZS, YS)) → perm_out(XS, cons(Y, YS))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
cons(x1, x2)  =  cons(x2)
U3(x1, x2, x3, x4)  =  U3(x4)
split_in(x1, x2, x3)  =  split_in(x1)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
nil  =  nil
split_out(x1, x2, x3)  =  split_out(x2, x3)
U4(x1, x2, x3, x4, x5, x6)  =  U4(x6)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4)  =  U5(x4)
perm_out(x1, x2)  =  perm_out(x2)
SPLIT_IN(x1, x2, x3)  =  SPLIT_IN(x1)
U51(x1, x2, x3, x4)  =  U51(x4)
U31(x1, x2, x3, x4)  =  U31(x4)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)
U41(x1, x2, x3, x4, x5, x6)  =  U41(x6)
PERM_IN(x1, x2)  =  PERM_IN(x1)
U21(x1, x2, x3, x4, x5)  =  U21(x5)
U11(x1, x2, x3, x4, x5)  =  U11(x5)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(XS, cons(Y, YS)) → U31(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
PERM_IN(XS, cons(Y, YS)) → SPLIT_IN(XS, YS1, cons(Y, YS2))
SPLIT_IN(cons(X, XS), cons(X, YS1), YS2) → U21(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
SPLIT_IN(cons(X, XS), cons(X, YS1), YS2) → SPLIT_IN(XS, YS1, YS2)
U31(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U41(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
U31(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → APPEND_IN(YS1, YS2, ZS)
APPEND_IN(cons(X, XS1), XS2, cons(X, YS)) → U11(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
APPEND_IN(cons(X, XS1), XS2, cons(X, YS)) → APPEND_IN(XS1, XS2, YS)
U41(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U51(XS, Y, YS, perm_in(ZS, YS))
U41(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → PERM_IN(ZS, YS)

The TRS R consists of the following rules:

perm_in(XS, cons(Y, YS)) → U3(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
split_in(cons(X, XS), cons(X, YS1), YS2) → U2(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
split_in(XS, nil, XS) → split_out(XS, nil, XS)
U2(X, XS, YS1, YS2, split_out(XS, YS1, YS2)) → split_out(cons(X, XS), cons(X, YS1), YS2)
U3(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U4(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
append_in(cons(X, XS1), XS2, cons(X, YS)) → U1(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
append_in(nil, XS, XS) → append_out(nil, XS, XS)
U1(X, XS1, XS2, YS, append_out(XS1, XS2, YS)) → append_out(cons(X, XS1), XS2, cons(X, YS))
U4(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U5(XS, Y, YS, perm_in(ZS, YS))
perm_in(nil, nil) → perm_out(nil, nil)
U5(XS, Y, YS, perm_out(ZS, YS)) → perm_out(XS, cons(Y, YS))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
cons(x1, x2)  =  cons(x2)
U3(x1, x2, x3, x4)  =  U3(x4)
split_in(x1, x2, x3)  =  split_in(x1)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
nil  =  nil
split_out(x1, x2, x3)  =  split_out(x2, x3)
U4(x1, x2, x3, x4, x5, x6)  =  U4(x6)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4)  =  U5(x4)
perm_out(x1, x2)  =  perm_out(x2)
SPLIT_IN(x1, x2, x3)  =  SPLIT_IN(x1)
U51(x1, x2, x3, x4)  =  U51(x4)
U31(x1, x2, x3, x4)  =  U31(x4)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)
U41(x1, x2, x3, x4, x5, x6)  =  U41(x6)
PERM_IN(x1, x2)  =  PERM_IN(x1)
U21(x1, x2, x3, x4, x5)  =  U21(x5)
U11(x1, x2, x3, x4, x5)  =  U11(x5)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 5 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN(cons(X, XS1), XS2, cons(X, YS)) → APPEND_IN(XS1, XS2, YS)

The TRS R consists of the following rules:

perm_in(XS, cons(Y, YS)) → U3(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
split_in(cons(X, XS), cons(X, YS1), YS2) → U2(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
split_in(XS, nil, XS) → split_out(XS, nil, XS)
U2(X, XS, YS1, YS2, split_out(XS, YS1, YS2)) → split_out(cons(X, XS), cons(X, YS1), YS2)
U3(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U4(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
append_in(cons(X, XS1), XS2, cons(X, YS)) → U1(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
append_in(nil, XS, XS) → append_out(nil, XS, XS)
U1(X, XS1, XS2, YS, append_out(XS1, XS2, YS)) → append_out(cons(X, XS1), XS2, cons(X, YS))
U4(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U5(XS, Y, YS, perm_in(ZS, YS))
perm_in(nil, nil) → perm_out(nil, nil)
U5(XS, Y, YS, perm_out(ZS, YS)) → perm_out(XS, cons(Y, YS))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
cons(x1, x2)  =  cons(x2)
U3(x1, x2, x3, x4)  =  U3(x4)
split_in(x1, x2, x3)  =  split_in(x1)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
nil  =  nil
split_out(x1, x2, x3)  =  split_out(x2, x3)
U4(x1, x2, x3, x4, x5, x6)  =  U4(x6)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4)  =  U5(x4)
perm_out(x1, x2)  =  perm_out(x2)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

APPEND_IN(cons(X, XS1), XS2, cons(X, YS)) → APPEND_IN(XS1, XS2, YS)

R is empty.
The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x2)
APPEND_IN(x1, x2, x3)  =  APPEND_IN(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

APPEND_IN(cons(XS1), XS2) → APPEND_IN(XS1, XS2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN(cons(X, XS), cons(X, YS1), YS2) → SPLIT_IN(XS, YS1, YS2)

The TRS R consists of the following rules:

perm_in(XS, cons(Y, YS)) → U3(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
split_in(cons(X, XS), cons(X, YS1), YS2) → U2(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
split_in(XS, nil, XS) → split_out(XS, nil, XS)
U2(X, XS, YS1, YS2, split_out(XS, YS1, YS2)) → split_out(cons(X, XS), cons(X, YS1), YS2)
U3(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U4(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
append_in(cons(X, XS1), XS2, cons(X, YS)) → U1(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
append_in(nil, XS, XS) → append_out(nil, XS, XS)
U1(X, XS1, XS2, YS, append_out(XS1, XS2, YS)) → append_out(cons(X, XS1), XS2, cons(X, YS))
U4(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U5(XS, Y, YS, perm_in(ZS, YS))
perm_in(nil, nil) → perm_out(nil, nil)
U5(XS, Y, YS, perm_out(ZS, YS)) → perm_out(XS, cons(Y, YS))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
cons(x1, x2)  =  cons(x2)
U3(x1, x2, x3, x4)  =  U3(x4)
split_in(x1, x2, x3)  =  split_in(x1)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
nil  =  nil
split_out(x1, x2, x3)  =  split_out(x2, x3)
U4(x1, x2, x3, x4, x5, x6)  =  U4(x6)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4)  =  U5(x4)
perm_out(x1, x2)  =  perm_out(x2)
SPLIT_IN(x1, x2, x3)  =  SPLIT_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN(cons(X, XS), cons(X, YS1), YS2) → SPLIT_IN(XS, YS1, YS2)

R is empty.
The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x2)
SPLIT_IN(x1, x2, x3)  =  SPLIT_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SPLIT_IN(cons(XS)) → SPLIT_IN(XS)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(XS, cons(Y, YS)) → U31(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
U31(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U41(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
U41(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → PERM_IN(ZS, YS)

The TRS R consists of the following rules:

perm_in(XS, cons(Y, YS)) → U3(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
split_in(cons(X, XS), cons(X, YS1), YS2) → U2(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
split_in(XS, nil, XS) → split_out(XS, nil, XS)
U2(X, XS, YS1, YS2, split_out(XS, YS1, YS2)) → split_out(cons(X, XS), cons(X, YS1), YS2)
U3(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U4(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
append_in(cons(X, XS1), XS2, cons(X, YS)) → U1(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
append_in(nil, XS, XS) → append_out(nil, XS, XS)
U1(X, XS1, XS2, YS, append_out(XS1, XS2, YS)) → append_out(cons(X, XS1), XS2, cons(X, YS))
U4(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → U5(XS, Y, YS, perm_in(ZS, YS))
perm_in(nil, nil) → perm_out(nil, nil)
U5(XS, Y, YS, perm_out(ZS, YS)) → perm_out(XS, cons(Y, YS))

The argument filtering Pi contains the following mapping:
perm_in(x1, x2)  =  perm_in(x1)
cons(x1, x2)  =  cons(x2)
U3(x1, x2, x3, x4)  =  U3(x4)
split_in(x1, x2, x3)  =  split_in(x1)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
nil  =  nil
split_out(x1, x2, x3)  =  split_out(x2, x3)
U4(x1, x2, x3, x4, x5, x6)  =  U4(x6)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out(x3)
U5(x1, x2, x3, x4)  =  U5(x4)
perm_out(x1, x2)  =  perm_out(x2)
U31(x1, x2, x3, x4)  =  U31(x4)
U41(x1, x2, x3, x4, x5, x6)  =  U41(x6)
PERM_IN(x1, x2)  =  PERM_IN(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN(XS, cons(Y, YS)) → U31(XS, Y, YS, split_in(XS, YS1, cons(Y, YS2)))
U31(XS, Y, YS, split_out(XS, YS1, cons(Y, YS2))) → U41(XS, Y, YS, YS1, YS2, append_in(YS1, YS2, ZS))
U41(XS, Y, YS, YS1, YS2, append_out(YS1, YS2, ZS)) → PERM_IN(ZS, YS)

The TRS R consists of the following rules:

split_in(cons(X, XS), cons(X, YS1), YS2) → U2(X, XS, YS1, YS2, split_in(XS, YS1, YS2))
split_in(XS, nil, XS) → split_out(XS, nil, XS)
append_in(cons(X, XS1), XS2, cons(X, YS)) → U1(X, XS1, XS2, YS, append_in(XS1, XS2, YS))
append_in(nil, XS, XS) → append_out(nil, XS, XS)
U2(X, XS, YS1, YS2, split_out(XS, YS1, YS2)) → split_out(cons(X, XS), cons(X, YS1), YS2)
U1(X, XS1, XS2, YS, append_out(XS1, XS2, YS)) → append_out(cons(X, XS1), XS2, cons(X, YS))

The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons(x2)
split_in(x1, x2, x3)  =  split_in(x1)
U2(x1, x2, x3, x4, x5)  =  U2(x5)
nil  =  nil
split_out(x1, x2, x3)  =  split_out(x2, x3)
append_in(x1, x2, x3)  =  append_in(x1, x2)
U1(x1, x2, x3, x4, x5)  =  U1(x5)
append_out(x1, x2, x3)  =  append_out(x3)
U31(x1, x2, x3, x4)  =  U31(x4)
U41(x1, x2, x3, x4, x5, x6)  =  U41(x6)
PERM_IN(x1, x2)  =  PERM_IN(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ RuleRemovalProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN(XS) → U31(split_in(XS))
U31(split_out(YS1, cons(YS2))) → U41(append_in(YS1, YS2))
U41(append_out(ZS)) → PERM_IN(ZS)

The TRS R consists of the following rules:

split_in(cons(XS)) → U2(split_in(XS))
split_in(XS) → split_out(nil, XS)
append_in(cons(XS1), XS2) → U1(append_in(XS1, XS2))
append_in(nil, XS) → append_out(XS)
U2(split_out(YS1, YS2)) → split_out(cons(YS1), YS2)
U1(append_out(YS)) → append_out(cons(YS))

The set Q consists of the following terms:

split_in(x0)
append_in(x0, x1)
U2(x0)
U1(x0)

We have to consider all (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

U31(split_out(YS1, cons(YS2))) → U41(append_in(YS1, YS2))

Strictly oriented rules of the TRS R:

split_in(XS) → split_out(nil, XS)

Used ordering: POLO with Polynomial interpretation [25]:

POL(PERM_IN(x1)) = 2 + 2·x1   
POL(U1(x1)) = 2 + x1   
POL(U2(x1)) = 2 + x1   
POL(U31(x1)) = 2·x1   
POL(U41(x1)) = 2 + 2·x1   
POL(append_in(x1, x2)) = x1 + x2   
POL(append_out(x1)) = x1   
POL(cons(x1)) = 2 + x1   
POL(nil) = 0   
POL(split_in(x1)) = 1 + x1   
POL(split_out(x1, x2)) = x1 + x2   



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN(XS) → U31(split_in(XS))
U41(append_out(ZS)) → PERM_IN(ZS)

The TRS R consists of the following rules:

split_in(cons(XS)) → U2(split_in(XS))
append_in(cons(XS1), XS2) → U1(append_in(XS1, XS2))
append_in(nil, XS) → append_out(XS)
U2(split_out(YS1, YS2)) → split_out(cons(YS1), YS2)
U1(append_out(YS)) → append_out(cons(YS))

The set Q consists of the following terms:

split_in(x0)
append_in(x0, x1)
U2(x0)
U1(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 2 less nodes.